package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.util.StringUtil;

/**
 * 用户银行账户信息表
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "account_bank")
public class AccountBank {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 用户ID */
    @Column(name = "user_id")
    private long userId;

    /** 银行账号 */
    private String bankNo;

    /** 所属银行 */
    private long bank;

    /** 支行 */
    private String branch;

    /** 省 */
    private String province;

    /** 市 */
    private String city;

    /** 区 */
    private String area;

    /** 添加时间 */
    private Date addTime;

    /** 添加IP */
    private String addIp;

    /** 0：关闭，1：启用 */
    private int status;

    /** 银行图片路径 */
    private String picPath;

    /** 钱包系统卡ID */
    private String tppCardId;

    /** 手机号 */
    @Column(name = "mobile_phone")
    private String mobilephone;

    /** 是否安全卡 */
    @Column(name = "is_safe")
    private Integer isSafe;

    /**
     * 获取(隐藏一定位数的)银行账号
     *
     * @return 银行账号
     */
    public String getHideBankNo() {
        if (StringUtil.isNotBlank(bankNo)) {
            return "******" + bankNo.substring(bankNo.length() - 4, bankNo.length());
        }
        return "";
    }

    /**
     * 获取主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置主键
     *
     * @param id 要设置的主键
     */
    public void setId(long id) {
        this.id = id;
    }


    public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	/**
     * 获取银行账号
     *
     * @return 银行账号
     */
    public String getBankNo() {
        return bankNo;
    }

    /**
     * 设置银行账号
     *
     * @param bankNo 要设置的银行账号
     */
    public void setBankNo(String bankNo) {
        this.bankNo = bankNo;
    }

    /**
     * 获取所属银行
     *
     * @return 所属银行
     */
    public long getBank() {
        return bank;
    }

    /**
     * 设置所属银行
     *
     * @param bank 要设置的所属银行
     */
    public void setBank(long bank) {
        this.bank = bank;
    }

    /**
     * 获取支行
     *
     * @return 支行
     */
    public String getBranch() {
        return branch;
    }

    /**
     * 设置支行
     *
     * @param branch 要设置的支行
     */
    public void setBranch(String branch) {
        this.branch = branch;
    }


    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    /**
     * 获取添加IP
     *
     * @return 添加IP
     */
    public String getAddIp() {
        return addIp;
    }

    /**
     * 设置添加IP
     *
     * @param addIp 要设置的添加IP
     */
    public void setAddIp(String addIp) {
        this.addIp = addIp;
    }

    /**
     * 获取0：关闭，1：启用
     *
     * @return 0：关闭，1：启用
     */
    public int getStatus() {
        return status;
    }

    /**
     * 设置0：关闭，1：启用
     *
     * @param status 要设置的0：关闭，1：启用
     */
    public void setStatus(int status) {
        this.status = status;
    }

    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }

    public String getTppCardId() {
        return tppCardId;
    }

    public void setTppCardId(String tppCardId) {
        this.tppCardId = tppCardId;
    }

    public String getMobilephone() {
        return mobilephone;
    }

    public void setMobilephone(String mobilephone) {
        this.mobilephone = mobilephone;
    }

    public Integer getIsSafe() {
        return isSafe;
    }

    public void setIsSafe(Integer isSafe) {
        this.isSafe = isSafe;
    }

}
